package cn.zn.modules.budget.cur.dao;

import cn.zn.framework.common.vo.CodeNameVO;
import cn.zn.modules.budget.cur.entity.TBudgetInfoDetailEntity;
import cn.zn.modules.budget.vo.ProjectMaxCodeAndDicType;
import cn.zn.modules.budget.vo.ProjectVo;
import cn.zn.modules.budget.vo.TempBudgetImportVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zn
 * @email zhunahao@qq.com
 * @date 2019-12-10 14:27:52
 */
@Mapper
public interface TBudgetInfoDetailDao extends BaseMapper<TBudgetInfoDetailEntity> {
    void insertAll(@Param("list") List<TBudgetInfoDetailEntity> list);

    int existTable();

    void dropTempBudgetImport();

    void createTempBudgetImport();

    void clearTempBudgetImport();

    int insertTempBudgetImport(@Param("list") List<TempBudgetImportVo> tempBudgetImportVos);

    int updateTempBudgetImportDept(@Param("deptCode") String deptCode, @Param("deptName") String deptName, @Param("deptOld") String deptOld);

    int updateTempBudgetImportProjectCode(@Param("projectCode") String projectCode, @Param("projectName") String projectName);

    List<TempBudgetImportVo> selectTempBudgetImport();

    List<String> queryNoDept();

    List<String> queryNoProject();

    List<CodeNameVO> queryDepts(@Param("dept") String dept);

    List<CodeNameVO> queryProjects(@Param("project") String project);

    ProjectMaxCodeAndDicType queryProjectsMaxCode();

    int insertProjects(@Param("list") List<ProjectVo> list);

    List<TBudgetInfoDetailEntity> queryPage(@Param("tBudgetInfoDetail") TBudgetInfoDetailEntity tBudgetInfoDetail, IPage<TBudgetInfoDetailEntity> page);
}
